package org.example.infrastructure.persistence.remote;

import org.example.domain.model.entity.url.resp.QueryGroupByCountResp;
import org.example.infrastructure.persistence.remote.fallbackFactory.RemoteUrlShortenerFallbackFactory;
import org.example.web.result.ResultInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 短链接中台远程调用服务
 */

@FeignClient(value = "url-shortener-core", contextId = "RemoteUrlShortenerPersistence", path = "/api/v1", fallbackFactory = RemoteUrlShortenerFallbackFactory.class)
public interface RemoteUrlShortenerPersistence {
    /**
     * 查询分组短链接总量
     */
    @PostMapping("/queryGroupByCount")
    ResultInfo<List<QueryGroupByCountResp>> queryGroupByCount(@RequestBody List<String> gidList);

}
